﻿//BasketSecurity.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.BusinessEntities
{
	using System.Collections.Generic;
	using System.ComponentModel;

	using Ecng.Collections;

	/// <summary>
	/// Корзина инструментов.
	/// </summary>
	public abstract class BasketSecurity : Security
	{
		/// <summary>
		/// Инициализировать <see cref="BasketSecurity"/>.
		/// </summary>
		protected BasketSecurity()
		{
		}

		/// <summary>
		/// Инструменты, из которых создана данная корзина.
		/// </summary>
		[Browsable(false)]
		public abstract IEnumerable<Security> InnerSecurities { get; }

		/// <summary>
		/// Шлюз к торговой системе, через который был загружен данный инструмент.
		/// </summary>
		public override ITrader Trader
		{
			set
			{
				InnerSecurities.ForEach(s => s.Trader = value);
				base.Trader = value;
			}
		}
	}
}